package com.example.demo.mapper;

import com.example.demo.pojo.ElectricityRate;
import com.example.demo.pojo.WaterRate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RateMapper {

    @Update("update waterrate set costperunit=#{costperunit},startvalue=#{startvalue},endvalue=#{endvalue} where waterrateid=#{waterrateid}")
    void updatewater(WaterRate waterRate);

    @Update("update electricityrate set costperunit=#{costperunit},startvalue=#{startvalue},endvalue=#{endvalue} where electricityrateid=#{electricityrateid}")
    void updateelectricity(ElectricityRate electricityrate);

    @Select("select * from waterrate")
    List<WaterRate> selectwater();

    @Select("select * from electricityrate")
    List<ElectricityRate> selectelectricity();
}
